package com.controller;

import com.javabean.Account;
import com.mapper.AccountMapper;
import com.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class AccountController {
    @Autowired
    AccountService accountService;

    @RequestMapping("/findAll")
    public String findAll(HttpServletRequest request){
        List<Account> all = accountService.findAll();
        request.setAttribute("all", all);
        return "account-all";
    }
    @RequestMapping("/main")
    public String main(){
        return "main";
    }
    @RequestMapping("/goProduct")
    public String goProduct(){
        return "/product/product-list";
    }

    @RequestMapping("/goOrders")
    public String goOrders(){
        return "/orders/orders-list";
    }

    @RequestMapping("/goUsers")
    public String goUsers(){
        return "/users/users-list";
    }
    @RequestMapping("/goRole")
    public String goRole(){
        return "/role/role-list";
    }
    @RequestMapping("/goPermission")
    public String goPermission(){
        return "/permission/permission-list";
    }
    @RequestMapping("/goSysLog")
    public String goSysLog(){
        return "/syslog/syslog-list";
    }
}
